package com.xueyi.system.company.manager.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xueyi.system.company.domain.query.CompanyQuery;
import com.xueyi.system.company.domain.dto.CompanyDto;
import com.xueyi.system.company.domain.po.CompanyPo;
import com.xueyi.system.company.domain.model.CompanyConverter;
import com.xueyi.system.company.mapper.CompanyMapper;
import com.xueyi.common.web.entity.manager.impl.BaseManager;
import com.xueyi.system.company.manager.ICompanyManager;
import org.springframework.stereotype.Component;

/**
 * 企业基础信息管理管理 数据封装层处理
 *
 * @author yanhe
 */
@Component
public class CompanyManager extends BaseManager<CompanyQuery, CompanyDto, CompanyPo, CompanyMapper, CompanyConverter> implements ICompanyManager {




    /**
     * 修改企业头像
     *
     * @param id     企业Id
     * @param logo 头像地址
     * @return 结果
     */
    @Override
    public int updateUserAvatar(Long id, String logo) {
        return baseMapper.update(new CompanyDto(),
                Wrappers.<CompanyPo>update().lambda()
                        .set(CompanyPo::getLogo, logo)
                        .eq(CompanyPo::getId, id));
    }

}